Set finalize handler; (gtk_calendar_finalize): Rename gtk_calendar_destroy
authorAnders Carlsson <andersca@gnu.org>
Sun, 10 Feb 2002 14:33:06 +0000 (14:33 +0000)
committerAnders Carlsson <andersca@src.gnome.org>
Sun, 10 Feb 2002 14:33:06 +0000 (14:33 +0000)
2002-02-10  Anders Carlsson  <andersca@gnu.org>

* gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
(gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
since ::destroy can be called multiple times, resulting in double-freeing memory.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcalendar.c

index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index 9e55008909fafc6e416e30076866ad5d97ae27d0..bf10eb4e2ed9000a7089b3f609946bd7753104fc 100644 (file)
@@ -1,3 +1,9 @@
+2002-02-10  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtkcalendar.c (gtk_calendar_class_init): Set finalize handler;
+       (gtk_calendar_finalize): Rename gtk_calendar_destroy to gtk_calendar_finalize
+       since ::destroy can be called multiple times, resulting in double-freeing memory.
+
 2002-02-10  Hans Breuer  <hans@breuer.org>
 
        * gdk/win32/gdkgeometry-win32.c : don't reduce the scroll
index cb5d51ae7b2e5497c1beb62bb181875bcdeb01e8..ff2fb029c9a375c39b6016b57bab9367cedd1757 100644 (file)
@@ -258,7 +258,7 @@ typedef void (*GtkCalendarSignalDate) (GtkObject *object, guint arg1, guint arg2
 
 static void gtk_calendar_class_init    (GtkCalendarClass *class);
 static void gtk_calendar_init          (GtkCalendar *calendar);
-static void gtk_calendar_destroy       (GtkObject *calendar);
+static void gtk_calendar_finalize      (GObject *calendar);
 static void gtk_calendar_realize       (GtkWidget *widget);
 static void gtk_calendar_unrealize     (GtkWidget *widget);
 static void gtk_calendar_size_request  (GtkWidget *widget,
@@ -334,15 +334,17 @@ gtk_calendar_get_type (void)
 static void
 gtk_calendar_class_init (GtkCalendarClass *class)
 {
+  GObjectClass   *gobject_class;
   GtkObjectClass *object_class;
   GtkWidgetClass *widget_class;
-  
+
+  gobject_class = (GObjectClass*)  class;
   object_class = (GtkObjectClass*) class;
   widget_class = (GtkWidgetClass*) class;
   
   parent_class = gtk_type_class (GTK_TYPE_WIDGET);
   
-  object_class->destroy = gtk_calendar_destroy;
+  gobject_class->finalize = gtk_calendar_finalize;
 
   widget_class->realize = gtk_calendar_realize;
   widget_class->unrealize = gtk_calendar_unrealize;
@@ -2495,13 +2497,15 @@ gtk_calendar_state_changed (GtkWidget      *widget,
 }
 
 static void
-gtk_calendar_destroy (GtkObject *object)
+gtk_calendar_finalize (GObject *object)
 {
   GtkCalendarPrivateData *private_data;
   private_data = GTK_CALENDAR_PRIVATE_DATA (object);
+  
   g_free (private_data);
-  if (GTK_OBJECT_CLASS (parent_class)->destroy)
-    (* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
+  
+  if (G_OBJECT_CLASS (parent_class)->finalize)
+    (* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
 
 static gboolean